<%--
  Created by IntelliJ IDEA.
  User: 29460
  Date: 2020/11/9
  Time: 18:36
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <link rel="stylesheet" href="./layui/css/layui.css">
    <script src="js/jquery-3.2.1.js"></script>
    <script src="layui/layui.js"></script>
</head>
<body>
<div style="width: 100%; margin: 0 auto" >
    <table id="showAll" lay-filter="test"></table>
</div>
</body>
<script>
    layui.use(['table','layer','form'], function(){
        var table = layui.table;
        var form = layui.form;
        var layer= layui.layer;
        var tab= table.render({
            elem: '#showAll'
            ,height:500
            ,url: 'tbc/list' //数据接口
            ,page: true //开启分页
            ,toolbar: '#deletebar' //开启头部工具栏，并为其绑定左侧模板
            ,defaultToolbar: ['filter', 'exports', 'print', { //自定义头部工具栏右侧图标。如无需自定义，去除该参数即可
                title: '提示'
                ,layEvent: 'LAYTABLE_TIPS'
                ,icon: 'layui-icon-tips'
            }]
            ,limit:3
            ,limits:[3,6,9]
            ,cols: [[ //表头
                {type: 'checkbox', fixed: 'left' ,title:"全选/全不选",width:30},
                {field: 'id', title: '编号', sort: true, fixed: 'left'}
                ,{field: 'parentId', title: '分类id'}
                ,{field: 'title', title: '标题'}
                ,{field: 'name', title: '分类名称'}
                ,{field: 'status', title: '状态。可选值:1(正常),2(删除)'}
                ,{field: 'sortOrder', title: '排列序号，表示同级类目的展现次序，如数值相等则按名称次序排列。取值范围:大于零的整数'}
                ,{field: 'isParent', title: '该类目是否为父类目，1为true，0为false'}
                ,{field: 'created', title: '创建时间'}
                ,{field: 'updated', title: '更新时间'}
                ,{fixed: 'right', title:'操作', toolbar: '#barDemo', width:150}
            ]]
            ,request: {
                pageName: 'page' //页码的参数名称，默认：page
                ,limitName: 'pageSize' //每页数据量的参数名，默认：limit
            }
        });
    })
</script>
</html>
